<template>
  <view class="container">
		<nav-ber :title="'二维码'" :bgColor="'#f7f8ff'"></nav-ber>
		<view class="" style="display: flex;justify-content: center;margin-top: 50rpx;">
			<canvas style="width: 600rpx; height: 600rpx;" canvas-id="myQrcode"></canvas>
		</view>
		<!-- <image style="width: 600rpx;height: 600rpx;margin: auto;" :src="urls" mode=""></image> -->
  </view>
</template>
<script>
	import request from '@/utils/request'
	let drawQrcode = require("./qrcode.js")
  export default {
    data() {
			return {
				keyword: '',
				ispro: '1',
				magList: [],
				urls: '',
			}
    },
		onShow() {
			this.qrcodeFun()
		},
		methods: {
			 // 生成二维码
			  qrcodeFun(url) {
					// console.log('drawQrcode', drawQrcode)
			    let size = {}
			    size.w = uni.getSystemInfoSync().windowWidth / 750 * 600
			    size.h = size.w
			    // 绘制二维码
			    drawQrcode({
			      width: size.w,
			      height: size.h,
			      canvasId: 'myQrcode',
						// text: 'https://mkt.zjkqjt.com' &Id=${JSON.parse(uni.getStorageSync('userInfoRole')).id}
			      text: `https://mkt.zjkqjt.com?setparm=getparm&agencyId=${JSON.parse(uni.getStorageSync('userInfoRole')).id}`,
			    })
			  },
		}
  }
</script>
<style lang="scss" scoped>

</style>
